package com.huai.demo_test1.test;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author huaixiaohuan
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Comparable {
    /**
     *  年龄
     */
    private long age;
    /**
        姓名
     */
    private String name;
    /**
        性别男
     */
    private boolean man;

    @Override
    public String toString() {
        return "(" + age + ", " + name + ", " 
            + (man ? "man":"woman") + ")";
    }
    @Override
    public int compareTo(Object o) {
        Student student = (Student) o;
        return (int)(age - student.getAge());
    }
}